<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
</head>
<body>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
	<form class="form-horizontal" onsubmit="return false" id="form">
		<fieldset>
			<input type="hidden" id="customerId" name="customerId">
<!--			<div class='form-group'>-->
<!--				<label class='col-md-2 control-label'>customerId</label>-->
<!--				<div class='col-md-10'>-->
<!--					<input class='form-control' placeholder='customerId' type='text' name='customerId' id='customerId' data-bv-notempty='true' data-bv-notempty-message='customerId 不能为空'>-->
<!--				</div>-->
<!--			</div>-->
			<div class='form-group'>
				<label class='col-md-2 control-label'>visitMsg</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='visitMsg' type='text' name='visitMsg' id='visitMsg' data-bv-notempty='true' data-bv-notempty-message='visitMsg 不能为空'>
				</div>
			</div>
<!--			<div class='form-group'>-->
<!--				<label class='col-md-2 control-label'>creater</label>-->
<!--				<div class='col-md-10'>-->
<!--					<input class='form-control' placeholder='creater' type='text' name='creater' id='creater' data-bv-notempty='true' data-bv-notempty-message='creater 不能为空'>-->
<!--				</div>-->
<!--			</div>-->
<!--			<div class='form-group'>-->
<!--				<label class='col-md-2 control-label'>createDate</label>-->
<!--				<div class='col-md-10'>-->
<!--					<input class='form-control' placeholder='createDate' type='text' name='createDate' id='createDate' data-bv-notempty='true' data-bv-notempty-message='createDate 不能为空'>-->
<!--				</div>-->
<!--			</div>-->
<!--			<div class='form-group'>-->
<!--				<label class='col-md-2 control-label'>modifyer</label>-->
<!--				<div class='col-md-10'>-->
<!--					<input class='form-control' placeholder='modifyer' type='text' name='modifyer' id='modifyer' data-bv-notempty='true' data-bv-notempty-message='modifyer 不能为空'>-->
<!--				</div>-->
<!--			</div>-->
<!--			<div class='form-group'>-->
<!--				<label class='col-md-2 control-label'>modifyDate</label>-->
<!--				<div class='col-md-10'>-->
<!--					<input class='form-control' placeholder='modifyDate' type='text' name='modifyDate' id='modifyDate' data-bv-notempty='true' data-bv-notempty-message='modifyDate 不能为空'>-->
<!--				</div>-->
<!--			</div>-->
			<div class='form-group'>
				<label class='col-md-2 control-label'>visitDate</label>
				<div class='col-md-10'>
					<input class='form-control' placeholder='visitDate' type='text' name='visitDate' id='visitDate' data-bv-notempty='true' data-bv-notempty-message='visitDate 不能为空'>
				</div>
			</div>


			<div class="form-actions">
				<div class="row" align="center">
					<div class="col-md-12">
					    <button class="btn btn-primary" onclick="location.href='customVisitInfoList.html'">返回</button>
						<button class="btn btn-primary" type="submit" onclick="add()">
							<i class="fa fa-save"></i> 保存
						</button>
					</div>
				</div>
			</div>

		</fieldset>
	</form>
</div>
	<script type="text/javascript" src="../../js/libs/jquery-2.1.1.min.js"></script>
	<script type="text/javascript" src="../../js/jq.js"></script>
	<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
	<script type="text/javascript" src="../../js/common.js"></script>
	<script type="text/javascript" src="../../layui/layui.js"></script>
	<script type="text/javascript">
		layui.use(['layer','laydate'], function(){
		    var layer = layui.layer;
			var laydate = layui.laydate;
			laydate.render({
				elem: '#visitDate'
			});
		});
		var customerId = getUrlParam("customerId");
		$("#customerId").val(customerId);
		function add() {
			$('#form').bootstrapValidator();
			var bootstrapValidator = $("#form").data('bootstrapValidator');
			bootstrapValidator.validate();
		    if(!bootstrapValidator.isValid()){
			   return;
		    }
		    
		    var formdata = $("#form").serializeObject();

			$.ajax({
				type : 'post',
				url : '/customVisitInfos',
				contentType: "application/json; charset=utf-8",  
				data : JSON.stringify(formdata),
				success : function(data) {
					layer.msg("添加成功", {shift: -1, time: 1000}, function(){
                        location.href = "customVisitInfoList.html";
                    });
				}
			});
		}
		
	</script>
</body>
</html>
